define_extension :base, :base do
  require "wondercap/lib/deployment/model/area"
  require "wondercap/lib/deployment/model/deployment"
  require "wondercap/lib/deployment/model/snapshot"

  require "wondercap/lib/deployment/core/local_build_repository"
  require "wondercap/lib/deployment/core/remote_deployment_repository"

  require "fileutils"
  
  set(:area) { outer_configuration.area }
  set(:build_repository) { Wondercap::Deployment::LocalProjectRepository.new(project_name, "/usr/local/wondercap2/build") }
  set(:deployment_repository) { Wondercap::Deployment::RemoteProjectRepository.new(project_name, "/usr/local/wondercap2/dep") }
  set(:revision_build) { build_repository[real_revision] }
  set(:revision_deployment) { deployment_repository[real_revision] }
  set(:installed_revision_deployment) do
    cur_snap = area.current_snapshot
    if cur_snap
      dep = cur_snap.find_deployment_by_name(project_name)
      deployment_repository[dep.revision] if dep
    end    
  end
  set :tags, []
end